open Printf
open Common
open Projects

(* let root = "prj" *)

(* let test_creation prjName = *)
(*	 try *)
(*		 printf "Creation test, start.\n"; *)
(*		 Project.create root prjName |> ignore; *)
(*		 printf "Creation test, end - ok.\n"; *)
(*	 with exn -> *)
(*		 printf "Creation test, end - fails: %s\n" (Printexc.to_string exn) *)

(* let test_existance prjName = *)
(*	 try *)
(*		 printf "Existance test, start.\n"; *)
(*		 assert ((Project.exists root prjName) == true); *)
(*		 printf "Existance test, end - ok.\n"; *)
(*	 with exn -> *)
(*		 printf "Existance test, end - fails: %s\n" (Printexc.to_string exn) *)

(* let test_deletion prjName = *)
(*	 try *)
(*		 printf "Deletion test, start.\n"; *)
(*		 assert( (Project.load root prjName |> Project.remove) == true ); *)
(*		 printf "Deletion test, end - ok.\n"; *)
(*	 with exn -> *)
(*		 printf "Deletion test, end - fails: %s\n" (Printexc.to_string exn) *)

let _ =
	try
		let prjs = Projects.open_projects (Filename.concat (Filename.dirname Sys.executable_name) "projects") in
		let prj1 = Projects.create prjs "first" in
			printf "%s\n" (Project.name prj1);
			Sys.remove
	with exn ->
		printf "Error: %s\n" (Printexc.to_string exn)
